Deavmi's coding shack
Node / personal / tlang_docs_old / files / new_docs / content / documentation / internals / codegen / vtable_mechanism.md
new_docs/content/documentation/internals/codegen/vtable_mechanism.md 8aab3cbf4b173d8fdc68ac6c6e7d8e6001f0612c (8aab3cbf) Text, 4.39 KB
title: Virtual Table implementation
date: 2021-04-20
tags: [documentation, internals, vtable]
This article aims to describe a possible virtual table implementation that we could use to for method dispatch that not only supports overriding but also interfaces.
As of so far the descriptions for the mechanism I came up with was only described through writing and with video explanations. Hopefully, in the future a text version (summrized) will be produced such that it can easily be digested. It will be under a nother version under the same title but with "(text version)" appended to it.
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-200326.webm" controls></video>
<p>Here I say <i>"Bruh"</i></p>
</center>
{{</bruh>}}
Introduction
This section provides an introduction to the features we want to implement, the problems they cause and how to solve them.
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-200335.webm" controls></video>
<p>Introduction</i></p>
</center>
{{</bruh>}}
This video describes what features we want in the language, what problems need to be solved to support them and why those problems exist.
The language is to support single-inheritance object-orientation but also with the ability to inherit from multiple interfaces (whilst the classes remain in a single hierachial order of inheritnce).
Single inheritance of classes
We will only allow each class to inherit from one other class. Below is an example of what is allowed, we have a class T383838A defined along with another class defined as T383838B whereby T383838B inherits from T383838A (via the T383838: operator).
T282828
Tff7b72class Te6edf3A
Tb4b4b4{
T8b949e/* TODO: Code goes here */
Tb4b4b4}
Tff7b72class Te6edf3B Tb4b4b4: Te6edf3A
Tb4b4b4{
T8b949e/* TODO: Code goes here */
Tb4b4b4}
THe example below defines classes T383838A, T383838B and T383838C, with T383838B inheriting from T383838A and T383838C, in T this woudl not be allowed.
T282828
Tff7b72class Te6edf3A
Tb4b4b4{
T8b949e/* TODO: Code goes here */
Tb4b4b4}
Tff7b72class Te6edf3C
Tb4b4b4{
T8b949e/* TODO: Code goes here */
Tb4b4b4}
Tff7b72class Te6edf3B Tb4b4b4: Te6edf3ATb4b4b4, Te6edf3C
Tb4b4b4{
T8b949e/* TODO: Code goes here */
Tb4b4b4}
Hypothetical secnario
In this situation I go about describing a situation and how my method would solve it. This part is several videos.
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-201005.webm" controls></video>
<p>Describing a situation/scenario and how I would go about solving it (1/5)</i></p>
</center>
{{</bruh>}}
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-201622.webm" controls></video>
<p>Describing a situation/scenario and how I would go about solving it (2/5)</i></p>
</center>
{{</bruh>}}
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-202902.webm" controls></video>
<p>Describing a situation/scenario and how I would go about solving it (3/5)</i></p>
</center>
{{</bruh>}}
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-203529.webm" controls></video>
<p>Describing a situation/scenario and how I would go about solving it (4/5)</i></p>
</center>
{{</bruh>}}
{{<bruh>}}
<center>
<video src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/2021-04-20-204452.webm" controls></video>
<p>Describing a situation/scenario and how I would go about solving it (5/5)</i></p>
</center>
{{</bruh>}}
Object Structure
Diagram (handwritten)
1. PDF file 1
2. PDF file 2
3. PDF file 3
{{<bruh>}}
<iframe src="/secret/tlangnotes/20th%20April%202021/OOP/runtimethunking/firststratergyforsupportinginterfaces_partb.pdf">
{{</bruh>}}
Diagram (computerized)
So far the structure is something like this (the below are unfinished, I will publish updated version of them soon). It will be more up-to-date than the PDFs above
Last update: 2021-06-08 9:44


Served by rngit 1.5.0 - Generated in 0.08s